package net.tv90.bfmccore.game;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class GameResourceParam implements Serializable {
    //占领点集合
    public List<ConquestAreaParam> conquestAreaList;
    //是否为前线模式，需要顺序占领
    public boolean isFrontLineMode;
    //mv世界名称
    public String worldName;
    //阵营A
    public String firstFaction;
    //阵营B
    public String secondFaction;
    //世界复活点
    public List<Integer> mainSpawnPoint;
    //阵营A死亡后的复活点
    public List<Integer> firstFactionSpawnPoint;
    //阵营B死亡后的复活点
    public List<Integer> secondFactionSpawnPoint;
    //用于TDM模式的重生点
    public PointListParam firstFactionSpawnPointList;
    public PointListParam secondFactionSpawnPointList;
    //最大时长
    public int maxTime;
    //最大兵力值
    public int maxTicket;
    //地图名称
    public String mapName;
    //游戏模式
    public EnumGameType gameType;
    //游戏模式中文翻译，小型征服、小型前线征服需要写
    public String gameType_Lang;
    //最大AI数量
    public int maxAi;
    //是否生成载具菜单
    public boolean generateMenu;
    //如果不为null，则启用地图相对坐标映射功能
    //填写2个二维向量作为地图图片左上角和右下角在游戏中对应的x和z坐标
    public List<List<Integer>> mapRelativeCood;

    //默认载具数量
    public int maxLightVehicleNum = 2;
    public int maxTankNum = 1;
    public int maxAANum = 1;
    public int maxHeliNum = 1;
    public int maxTransHeliNum = 1;
    public int maxJetNum = 1;
    public int maxAtkJetNum = 1;
    public int maxFacNum = 1;

    //默认载具冷却
    public int lightVehicleCooldownTime = 60;
    public int tankCooldownTime = 80;
    public int aaCooldownTime = 180;
    public int heliCooldownTime = 220;
    public int transHeliCooldownTime = 120;
    public int jetCooldownTime = 160;
    public int atkJetCooldownTime = 220;
    public int facCooldownTime = 120;

    //地图池索引，可填1,2,3,4
    public List<Integer> gamePoolIndex;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @ToString
    static class PointListParam implements Serializable {
        //坐标组引用文件中的list名
        public String listName;
        //坐标组引用文件中的相对路径
        public String relativePath;
        //若坐标不在文件中，直接填写list集合，不需要再填写上面的
        public List<List<Integer>> list;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @ToString
    static class AreaParam implements Serializable {
        //区域类型，包含RectangleArea3i(长方体),CircleArea3i(圆形区域带y轴范围),Area3i(多边形带y轴范围)
        public EnumAreaType type;
        //区域坐标list
        //对于RectangleArea3i，直接填2个3维向量作为顶点
        //对于CircleArea3i，填写一个2维向量作为圆心
        //对于Area3i，填写n个2维向量
        public List<List<Integer>> pointList;
        //区域参数list
        //对于RectangleArea3i，无需填写
        //对于CircleArea3i，填写一个3维向量，分别为半径，y轴min，y轴max
        //对于Area3i，填写一个2维向量，分别为y轴min，y轴max
        public List<Integer> paramList;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @ToString
    static class ConquestAreaParam implements Serializable {
        //占领点类型
        public EnumConquestAreaType type;
        //占领点区域参数
        public AreaParam areaParam;
        //占领点序号，为HQ/A/B/C/D...
        public String index;
        //占领点名称
        public String name;
        //占领点是否可占领
        public boolean canCapture;
        //占领点初始占领的阵营
        public String currentFaction;
        //占领点初始占领状态
        public String currentState;
        //占领点最大占领时长
        public int maxTime;
        //占领点占领后，多少秒扣除对面的1点兵力值
        public int secondPerTicket;
        //占领点图标参数
        public int imagePosX;
        public int imagePosY;
        public int imageWidth = 20;
        public int imageHeight = 20;
        //占领点是否有对应的载具类型
        public boolean hasLight = false;
        public boolean hasTank = false;
        public boolean hasAA = false;
        public boolean hasHeli = false;
        public boolean hasTransHeli = false;
        public boolean hasJet = false;
        public boolean hasAtkJet = false;
        public boolean hasFac = false;
        //占领点阵营1和2的步兵出生点，以及当区域被占领时的步兵出生点
        public PointListParam firstFactionSpawnPoint;
        public PointListParam secondFactionSpawnPoint;
        public PointListParam firstFactionSpawnPointWhenCapturing;
        public PointListParam secondFactionSpawnPointWhenCapturing;
        //占领点阵营1的载具出生点
        public PointListParam firstLightSpawnPoint;
        public PointListParam firstTankSpawnPoint;
        public PointListParam firstAASpawnPoint;
        public PointListParam firstHeliSpawnPoint;
        public PointListParam firstTransHeliSpawnPoint;
        public PointListParam firstJetSpawnPoint;
        public PointListParam firstAtkJetSpawnPoint;
        public PointListParam firstFacSpawnPoint;
        //占领点阵营2的载具出生点
        public PointListParam secondLightSpawnPoint;
        public PointListParam secondTankSpawnPoint;
        public PointListParam secondAASpawnPoint;
        public PointListParam secondHeliSpawnPoint;
        public PointListParam secondTransHeliSpawnPoint;
        public PointListParam secondJetSpawnPoint;
        public PointListParam secondAtkJetSpawnPoint;
        public PointListParam secondFacSpawnPoint;
        //占领点阵营1的载具组
        public List<String> firstLightVehicleGroup;
        public List<String> firstTankVehicleGroup;
        public List<String> firstAAVehicleGroup;
        public List<String> firstHeliVehicleGroup;
        public List<String> firstTransHeliVehicleGroup;
        public List<String> firstJetVehicleGroup;
        public List<String> firstAtkJetVehicleGroup;
        public List<String> firstFacVehicleGroup;
        //占领点阵营2的载具组
        public List<String> secondLightVehicleGroup;
        public List<String> secondTankVehicleGroup;
        public List<String> secondAAVehicleGroup;
        public List<String> secondHeliVehicleGroup;
        public List<String> secondTransHeliVehicleGroup;
        public List<String> secondJetVehicleGroup;
        public List<String> secondAtkJetVehicleGroup;
        public List<String> secondFacVehicleGroup;
    }
}
